// 页面加载完成后初始化用户中心交互逻辑
// Initialize profile interactions after DOM content loaded
document.addEventListener('DOMContentLoaded', () => {
    // 获取所有导航按钮和内容模块
    // Get all navigation buttons and content modules
    const buttons = document.querySelectorAll('.nav-btn');
    const modules = document.querySelectorAll('.content-module');

    // 使用事件委托处理导航点击
    // Event delegation for navigation clicks
    buttons.forEach(button => {
        button.addEventListener('click', () => {
            // 移除所有按钮激活状态
            // Remove active state from all buttons
            buttons.forEach(btn => btn.classList.remove('active'));
            
            // 设置当前按钮为激活状态
            // Set current button as active
            button.classList.add('active');
            
            // 隐藏所有内容模块
            // Hide all content modules
            modules.forEach(mod => mod.classList.remove('active'));
            
            // 显示目标内容模块并添加渐入动画
            // Show target module with fade-in animation
            const targetId = button.dataset.target;
            document.getElementById(targetId).classList.add('active');
        });
    });
});